Computing the UNID for the document data source is probably the only way, as the data source needs the UNID.
Another way would be to wrap the document in a bean, but you would probably run into "object has been recycled" issues.
What I tend to do is to have a object classes which represents the documents and a controller bean that handles events/validation for each kind of document. The controller bean uses a generalized DAO (Data Access Object) class to pull/push data to the server on load/save. It takes a lot more time to write, but you also get a lot more control.